‹#›
Inventor API 中的零件图、部件图和工程图
创建代理范例
Public Sub CreateProxy()
Dim oAsmDef As AssemblyComponentDefinition
oAsmDef = _InvApplication.ActiveDocument.ComponentDefinition
Dim oOcc1 As ComponentOccurrence = oAsmDef.Occurrences(1)
Dim oOcc2 As ComponentOccurrence = oAsmDef.Occurrences(2)
' Get the vertex through the occurrence
' which will return a VertexProxy object.
Dim oVertexPx1 As VertexProxy
oVertexPx1 = oOcc1.SurfaceBodies(1).Vertices(1)
' Get the vertex from the part and create a VertexProxy object.
Dim oVertex2 As Vertex
oVertex2 = oOcc2.Definition.SurfaceBodies(1).Vertices(1)
Dim oVertexPx2 As VertexProxy = Nothing
Call oOcc2.CreateGeometryProxy(oVertex2, oVertexPx2)
End Sub